import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:industry_net/base/common/util.dart';
import 'package:industry_net/base/component/component.dart';
import 'package:industry_net/base/component/list/table_view.dart';
import 'views/search_history.dart';
import 'controller.dart';

class SearchPage extends StatelessWidget {
  SearchPage({
    Key? key,
  }) : super(key: key);
  final controller = Get.put(SearchController());
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        leading: const SizedBox(
          width: 0,
        ),
        flexibleSpace: Padding(
          padding: EdgeInsets.only(top: SizeFit.statusBarHeight),
          child: Row(
            children: [
              SizedBox(
                width: gap12,
              ),
              searchBar(
                  hintText: '请输入关键词',
                  hintStyle: pfMediumStyle(
                      color: const Color(0xffbbbbbb), fontSize: font15),
                  iconColor: ColorsUtil.content,
                  backgroundColor: ColorsUtil.white,
                  borderColor: const Color(0xff119f4c),
                  focusBorderColor: const Color(0xff119f4c),
                  width: 311.w),
              Expanded(
                  child: InkWell(
                      onTap: () {
                        Get.back();
                      },
                      child: Container(
                        alignment: Alignment.center,
                        child: Text(
                          '取消',
                          style: pfMediumStyle(
                              color: ColorsUtil.title, fontSize: font14),
                        ),
                      )))
            ],
          ),
        ),
      ),
      body: TableView(
          separatorIndent: gap12 * 2,
          header: SearchHistoryView(),
          data: controller.state.hotSource),
    );
  }
}
